package com.chenpp.redis.pubsub;

import redis.clients.jedis.Jedis;

/**
 * @Description
 * @Author chenpp
 * @Date 2019/10/22 10:40
 */
public class Publish {
    public static void main(String[] args) throws InterruptedException {
        Jedis jedis = new Jedis("127.0.0.1", 6379);

        jedis.publish("course", "math");
        System.out.println("频道发布内容:math");
        Thread.sleep(2000);
        jedis.publish("course", "Chinese");
        System.out.println("频道发布内容:Chinese");
        Thread.sleep(2000);
        jedis.publish("course", "Art");
        System.out.println("频道发布内容:art");

        Thread.sleep(20000);
        jedis.publish("course", "English");
        System.out.println("频道发布内容:English");

        Thread.sleep(2000);

    }
}
